home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 012 / kbfix23.arc / KBFIX2.DOC < prev   
Encoding:
Text File  |  1985-06-18  |  17.8 KB  |  529 lines

  1.         KBFIX2.COM               VERSION 2.3             June 18, 1985
  2.  
  3.  
  4.  
  5.                                Copyright (C) 1985
  6.                                   Skip Gilbrech
  7.  
  8.                  ----------------------------------------------
  9.                  This program is intended for public-domain use
  10.                      It must not be sold under any condition
  11.                  ----------------------------------------------
  12.  
  13.                                   INTRODUCTION
  14.  
  15.         KBFIX2.COM is an extensively modified and enhanced version of an 
  16.         earlier program, KBFIX.COM.  The main purpose of that program was 
  17.         to display the status of the caps-, num-, and scroll-lock keys on 
  18.         the IBM-PC video screen, while providing an audible signal in the 
  19.         form of a low-to-high or high-to-low beep each time the status 
  20.         changed.  KBFIX also provided a 127-character keyboard buffer to 
  21.         replace the 15-character standard buffer.  
  22.  
  23.         KBFIX had only two options, however:  it could be installed with 
  24.         or without the buffer, and even that choice could be made only 
  25.         the first time the program was invoked.  Several people mentioned 
  26.         that they'd prefer to get rid of the beep, and others wanted the 
  27.         key-status display to appear at a different screen location, 
  28.         and/or not to disappear each time the screen was scrolled up a 
  29.         line.  In addition, the method I chose to implement the enlarged 
  30.         buffer made KBFIX incompatible with several popular programs:  
  31.         PROKEY wouldn't work properly, nor would any program that assumed 
  32.         the buffer was in its normal location.  It was to address these 
  33.         suggestions and problems that I started to write KBFIX2.
  34.  
  35.         While I was working on the timer interrupt routine for the key-
  36.         status display update, it occurred to me that it would be rela-
  37.         tively easy to include an option to adjust keyboard typematic 
  38.         rate.  There is a popular public-domain program, SPEEDKEY, that 
  39.         already does just that, but since it relies on specific bios-rom 
  40.         versions and addresses it can't be used on any machine it doesn't 
  41.         know about, no matter how otherwise compatible the machine might 
  42.         be.  It also, like the older version of KBFIX, has a few compati-
  43.         bility problems with other programs.  So I decided to include a 
  44.         typematic adjustment option to KBFIX2.  The method used, by the 
  45.         way, seems to work fine with the PC/AT, even though it's possible 
  46.         to adjust the typematic rate on that machine by sending a command 
  47.         directly to the keyboard.
  48.  
  49.         (added for version 2.1)
  50.         By popular demand(!), KBFIX2 now can be set to pause if the 
  51.         scroll-lock key is pressed.  The scroll-lock key can always be 
  52.         used normally (to shift the scroll-state) by depressing a shift 
  53.         key (Right/Left Shift or Alt) at the same time.  See the 'S' 
  54.         option below. 
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.                                     -- 1 --
  62.  
  63.  
  64.  
  65.  
  66.  
  67.         KBFIX2.COM               VERSION 2.3             June 18, 1985
  68.  
  69.  
  70.                                 USING THE PROGRAM
  71.  
  72.         KBFIX2 can be invoked from the command line or from within a 
  73.         batch file.  The first time the program is invoked it loads 
  74.         itself into memory (takes up about 2K); it will then remain 
  75.         resident until the system is rebooted.  The current configuration 
  76.         of KBFIX2 is selected by means of the command line options out-
  77.         lined below, any or all of which can be changed at any time.  
  78.         When the program starts up, it tries to find its loaded image in 
  79.         memory; if the image is found, all options currently in effect 
  80.         are copied to a local buffer where they are used as defaults, and 
  81.         all changes will be made to the memory-resident image. KBFIX2 
  82.         will never knowingly load more than one copy of itself into 
  83.         memory, so if you ever see the 'Initial Installation' message 
  84.         after KBFIX2 has once been loaded, please reboot and let me know 
  85.         about it.  
  86.  
  87.         Options can be entered separately or in groups.  Each option or 
  88.         group must be preceeded by '-' or '/', and must be separated from 
  89.         other groups by at least one space or tab.  There must be no 
  90.         spaces within groups.  To enable or disable an 'on/off' option, 
  91.         follow the letter(s) with 1 or 0.
  92.  
  93.           OPTION                                             DEFAULT
  94.           ------                                             -------
  95.  
  96.           KB --  use extended Keyboard Buffer                Enabled
  97.  
  98.              Enabling this option activates the 127-character keyboard 
  99.              buffer.  It also allows KBFIX2 to check for the special 
  100.              characters Ctrl-C, Ctrl-S, and Ctrl-P, which are normally 
  101.              only recognized by DOS if they appear at the beginning of 
  102.              the keyboard buffer.  If any one of these characters is 
  103.              typed while KBFIX2's buffer is active, the buffer will be 
  104.              cleared, and the character typed will be placed at its head.
  105.  
  106.           KT --  adjust Typematic action of Keys             Disabled
  107.  
  108.              Enabling this option allows adjusting the speed of typematic 
  109.              key repeating;  disabling it returns typematic action to 
  110.              normal.  The options below that start with 'KT' will retain 
  111.              their settings even if typematic is disabled, so it's not 
  112.              necessary to reenter them if it becomes necessary to shut 
  113.              off typematic temporarily.
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.                                     -- 2 --
  128.  
  129.  
  130.  
  131.  
  132.  
  133.         KBFIX2.COM               VERSION 2.3             June 18, 1985
  134.  
  135.  
  136.           OPTION                                             DEFAULT
  137.           ------                                             -------
  138.                 
  139.           KTD -- Ticks to Delay before starting (0-99)       6
  140.  
  141.              Sets the number of timer ticks which will occur before 
  142.              typematic repeating begins.  Timer ticks happen approximate-
  143.              ly once every 1/18th second, so if this number is larger 
  144.              than about 9, the only effect it will have is a speedup of 
  145.              the typematic rate of an already repeating key, since normal 
  146.              typematic action seems to start (on an IBM-PC, at least) 
  147.              about one-half second after the key is first pressed.  Per-
  148.              sonally I find a setting of 5 or 6 about right.
  149.  
  150.           KTR -- Ticks between key Repeats (0-99)            0
  151.  
  152.              Sets the number of timer ticks which will occur between 
  153.              repeats of the currently-pressed key.  Setting this option 
  154.              to zero results in 18 repeats per second.  These repeats are 
  155.              in addition to the normal typematic repeats produced by the 
  156.              keyboard, so the effective rate of repeating will be consid-
  157.              erably higher than the setting of this option would other-
  158.              wise indicate. 
  159.  
  160.           KTN -- Num. chars. inserted each repeat (1-10)     1
  161.  
  162.              Determines how many copies of the currently repeating key-
  163.              code to place into the keyboard buffer each time the key is 
  164.              repeated.  Fine tuning of the effective typematic rate is 
  165.              possible by experimenting with various combinations of this 
  166.              setting and the KTR setting above.
  167.  
  168.           F   -- Fix caps-lock reverse character shift       Enabled
  169.  
  170.              Tells KBFIX2 whether or not to fix the annoying 'reverse-
  171.              shift' which occurs when caps-lock is on and a shift key is 
  172.              pressed.  When I have caps-lock on, it's generally because I 
  173.              want capital letters to appear on the screen, and that's 
  174.              what will happen when this option is enabled.
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.                                     -- 3 --
  194.  
  195.  
  196.  
  197.  
  198.  
  199.         KBFIX2.COM               VERSION 2.3             June 18, 1985
  200.  
  201.  
  202.           OPTION                                             DEFAULT
  203.           ------                                             -------
  204.                 
  205.           D   -- Display state of locking keys               Enabled
  206.  
  207.              Enabling this option results in an on-screen display of the 
  208.              state of the caps-lock, num-lock, and scroll-lock toggles.  
  209.              The flags are initially set to display in normal-intensity 
  210.              reverse-video.  If you're familiar with patching files, 
  211.              though, you can change the characters displayed, and their 
  212.              attributes, by modifying the following 16-bit words in a 
  213.              copy of KBFIX2.COM, then rebooting and reinstalling the 
  214.              program.  Locations are in hex, relative to the beginning of 
  215.              the file (add 100H if using a debugger rather than a file 
  216.              patching program):
  217.  
  218.               Offset  Used For:                   Hex value of Char/Attr
  219.  
  220.               10H     Blanking Character          0720H (normal blank)
  221.               12H     Caps-Lock Flag              7043H (reverse 'C')
  222.               14H     Num-Lock Flag               704EH (reverse 'N')
  223.               16H     Scroll-Lock Flag            7053H (reverse 'S')
  224.  
  225.           C   -- starting Column for display (0-77)          77
  226.  
  227.              Sets the starting screen column for the 3-character flag 
  228.              display.
  229.  
  230.           R   -- Row for display (0-24)                      0
  231.  
  232.              Sets the row for the flag display.  If the row setting is 
  233.              other than 0, the flags will 'clone' themselves whenever the 
  234.              screen is scrolled.
  235.  
  236.           T   -- use Timer interrupt to update display       Disabled
  237.  
  238.              Enabling this option tells KBFIX2 to update the flag display 
  239.              18 times per second by using the user-timer interrupt; 
  240.              disabling it means the flags will only be updated whenever a 
  241.              key is pressed.  Use of this feature allows the flags to be 
  242.              seen in programs which would otherwise overwrite them be-
  243.              tween keypresses, but it also slows down the entire system 
  244.              slightly due to the overhead involved in writing to the 
  245.              screen.  The slow-down seems to be less than one percent, 
  246.              though, even when using a color monitor.  This option can't 
  247.              be enabled unless the D option above is also enabled.
  248.  
  249.           B   -- Beep when locking keys are toggled          Enabled
  250.  
  251.              Determines whether the bell will sound whenever the state of 
  252.              one of the toggling keys changes.  If this option is ena-
  253.              bled, the machine will beep from low to high whenever a 
  254.              toggle changes from off to on, and from high to low whenever 
  255.              a toggle changes from on to off.
  256.  
  257.  
  258.  
  259.                                     -- 4 --
  260.  
  261.  
  262.  
  263.  
  264.  
  265.         KBFIX2.COM               VERSION 2.3             June 18, 1985
  266.  
  267.  
  268.           OPTION                                             DEFAULT
  269.           ------                                             -------
  270.                 
  271.           S   -- Scroll lock pause control (Version 2.2)     Disabled
  272.  
  273.              Enabling this option will make KBFIX2 enter a loop whenever 
  274.              the scroll-lock key is pressed.  The loop will cause screen 
  275.              output, and any other non interrupt-driven activity, to 
  276.              pause until the next time scroll-lock is pressed (either by 
  277.              itself, or at the same time as shift key).  The scroll-lock 
  278.              key can always be used normally (to shift the scroll-state) 
  279.              by holding a shift key (Right/Left Shift or Alt) down at the 
  280.              same time.  If the D option is enabled, a blinking S will be 
  281.              displayed while the pause is in effect.
  282.  
  283.           V   -- Verbose display of current settings         Enabled
  284.  
  285.              Disabling this option prevents KBFIX2 from presenting its 
  286.              normal display of current settings.  To have any effect, 
  287.              this option must be specified each time KBFIX2 is invoked.
  288.  
  289.           -----------------------------------------------------------
  290.  
  291.          Example:  KBFIX2 /F0 /KT1 /KTD5 /D1 /T1 /C50 /R0 /B0 /V0
  292.  
  293.              disables the caps-lock fix, enables typematic adjustment, 
  294.              sets the type-matic delay (before starting to repeat a 
  295.              pressed key) to 5 ticks (5/18ths of a second), enables the 
  296.              key-state display and timer update, sets the display column 
  297.              and row to 50/0, disables toggle beeps, and tells KBFIX2 not 
  298.              to display its current settings.
  299.  
  300.         To avoid having to remember all this, enter your normal para-
  301.         meters in AUTOEXEC.BAT or in some other convenient batch file.
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.                                     -- 5 --
  326.  
  327.  
  328.  
  329.  
  330.  
  331.         KBFIX2.COM               VERSION 2.3             June 18, 1985
  332.  
  333.  
  334.                              HARDWARE COMPATIBILITY
  335.  
  336.         KBFIX2 should run on any IBM-PC, XT, or AT, and on most close 
  337.         compatibles.  Following are some of the assumptions it makes 
  338.         about the hardware:
  339.  
  340.           1) The screen memory starts at B000H (monochrome), and B800H 
  341.           (color); screen-related bios data locations are identical to 
  342.           those on the IBM-PC.
  343.  
  344.           2) The keyboard buffer starts at 40:1E and is organized like 
  345.           the standard IBM-PC buffer.
  346.  
  347.           3) The base port address of the 8259 interrupt controller is 
  348.           20H; the timer interrupt is on IRQ0, set up as interrupt 8;
  349.           the keyboard interrupt is on IRQ1 and is interrupt 9.  
  350.  
  351.           4) The base keyboard port address is 60H.
  352.  
  353.           5) The bios calls a user-timer routine (interrupt 1CH) approxi-
  354.           mately 18 times per second. 
  355.  
  356.  
  357.  
  358.  
  359.  
  360.  
  361.  
  362.  
  363.  
  364.  
  365.  
  366.  
  367.  
  368.  
  369.  
  370.  
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.                                     -- 6 --
  392.  
  393.  
  394.  
  395.  
  396.  
  397.         KBFIX2.COM               VERSION 2.3             June 18, 1985
  398.  
  399.  
  400.                              SOFTWARE COMPATIBILITY
  401.  
  402.         No program that deals with the hardware and system software on 
  403.         this level can hope to be compatible with everything else.  
  404.         KBFIX2 appears to work perfectly well with Sidekick, Dosedit, 
  405.         Prokey, Util (which places characters directly in the buffer), 
  406.         and every other program I've tried so far.  It also works well 
  407.         with Fansi-Console (replacement for Ansi.sys) if KBFIX2's buffer 
  408.         option is disabled, since Fansi provides its own enlarged 
  409.         keyboard buffer.
  410.  
  411.         I can offer, however, absolutely no guarantees.  I would like to 
  412.         be informed, though, at the address below, of any incompatibil-
  413.         ities found, so I can try to determine whether the incompatibil-
  414.         ity results from a problem within KBFIX2.  Before you decide that 
  415.         KBFIX2 is incompatible with something, by the way, try varying 
  416.         loading order, removing other resident programs, changing op-
  417.         tions, etc.  I've tried to give KBFIX2 as 'low a profile' as 
  418.         possible.  What I mean by that is that the interrupt handlers in 
  419.         KBFIX2 always pass control to whatever was there before, without 
  420.         changing the machine state at all.  That feature is useful, 
  421.         though, only when KBFIX2 is loaded last in the chain of interrupt 
  422.         handlers.  KBFIX2 constantly checks the keyboard buffer to deter-
  423.         mine whether another program has changed it, and if so, it defers 
  424.         to that program, resets its own buffer and variables, and uses 
  425.         the current buffer condition as a starting point for further 
  426.         processing.  KBFIX2 cannot, however, control what other programs 
  427.         do.
  428.  
  429.  
  430.  
  431.  
  432.  
  433.  
  434.  
  435.  
  436.  
  437.  
  438.  
  439.  
  440.  
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447.  
  448.  
  449.  
  450.  
  451.  
  452.  
  453.  
  454.  
  455.  
  456.  
  457.                                     -- 7 --
  458.  
  459.  
  460.  
  461.  
  462.  
  463.         KBFIX2.COM               VERSION 2.3             June 18, 1985
  464.  
  465.  
  466.                                      CHANGES
  467.  
  468.         V2.3 (6/18/85):  Fixed bug which resulted in the scroll-lock key 
  469.                          behaving like a typematic key.
  470.  
  471.         V2.2 (3/31/85):  Fixed bug in buffer logic which put the wrong 
  472.                          character in the bios keyboard buffer when the 
  473.                          extended buffer option was in effect, and char-
  474.                          acters were being typed slightly faster than 
  475.                          they were removed from the buffer (thanks to 
  476.                          Dave Rothman and Chris Dunford for reporting 
  477.                          this).
  478.  
  479.                          Changed format of current options display to be 
  480.                          consistent with actual setting of command-line 
  481.                          switches (thanks to Earle Robinson for the sug-
  482.                          gestion).
  483.  
  484.                          Changed scroll-lock pause to release only when 
  485.                          the scroll-lock key is pressed again.  If the 
  486.                          status display is active, a blinking S will 
  487.                          display while the pause is in effect.
  488.  
  489.         V2.1 (3/18/85):  Added scroll-lock pause feature ('s' option).
  490.  
  491.         V2.0 (3/16/85):  Original version described in this 
  492.                          documentation.
  493.  
  494.         Please direct all questions, suggestions and problem reports to:
  495.  
  496.             Skip Gilbrech
  497.             90 Lexington Ave. #10-G
  498.             New York, NY 10016
  499.             Compuserve: 71445,534 (messages left on PCS-131 preferred) 
  500.  
  501.  
  502.  
  503.  
  504.  
  505.  
  506.  
  507.  
  508.  
  509.  
  510.  
  511.  
  512.  
  513.  
  514.  
  515.  
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.                                     -- 8 --
  524.  
  525.  
  526.  
  527.  
  528.  
  529.